package com.belarus.kamianiec.photo.photoSite.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.belarus.kamianiec.photo.photoSite.dao.GalleryDAO;
import com.belarus.kamianiec.photo.photoSite.domain.Gallery;

@Service
public class GalleryServiceImpl implements GalleryService {

	private GalleryDAO galleryDAO;
	
	public GalleryServiceImpl() {
		
	}

	@Transactional
	public void addGallery(Gallery gallery) {
		galleryDAO.addGallery(gallery);
	}

	@Transactional
	public List<Gallery> listGallery() {

		return galleryDAO.listGallery();
	}

	@Transactional
	public void removeGallery(Integer id) {
		galleryDAO.removeGallery(id);
	}

	public GalleryDAO getGalleryDAO() {
		return galleryDAO;
	}

	@Autowired(required=false)
	public void setGalleryDAO(GalleryDAO galleryDAO) {
		this.galleryDAO = galleryDAO;
	}
}
